var User = require('../models/user');

module.exports = {
  addUser: function (req, res) {
    // var user = {
    //   username: req.body.username,
    //   password: req.body.password
    // };

    User.createUser(req.body).then(function (result) {
      if (result.status === false) {
        return res.send({status: false, message: '用户已存在'})
      }
      res.send({status: true})
    },function (error) {
      if (error) {
        return res.send({status: false, message: '添加用户失败'})
      }
    })
  }
};